import java.util.Scanner;

/**
 * Created by JiaJia on 2019/4/11 0011.
 */
public class WeiZhong02 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        while (sc.hasNext()){
            int num=sc.nextInt();
            for (int i = 0; i <=num ; i++) {
                int a=sc.nextInt();
                System.out.println(count(a));
            }
        }
        sc.close();
    }

    private static int count(int number){
        int result=0;
        if(number==1){
            return 0;
        }
        while (number>1){
            if(number%2!=0){
                number=3*number+1;
                result++;
            }else {
                number=number/2;
                result++;
            }
        }
        return result;

    }

}